package com.example.feigndemo.controller;

import com.example.feigndemo.feign.UserFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 文希
 * @create 2019-05-26 1:13
 */
@RestController
public class UserController {
    private static Logger logger = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private UserFeign userFeign;

    @GetMapping("/info")
    public String info() {
        String info = userFeign.info(); // 使用feign做远程调用
        logger.info("{}",info);
        return "我是远程调用的结果："+info;
    }
}
